package a.f.j.a;

import a.c.*;
import a.c.d;
import a.f.j.cb;
import a.f.j.n;

import java.util.ArrayList;
import java.util.Iterator;

public class c
  implements o
{
  cb a;
  q b;
  k[] c;
  protected a[] d = new a[2];
  protected a e = new a();
  private a f = new a();
  l g;
  public static boolean h;
  public static boolean i;
  
  public c()
  {
    this(new m());
  }
  
  c(l paraml)
  {
    this.d[0] = new a();
    this.d[1] = new a();
    this.g = paraml;
  }
  
  public String toString()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    String str = "";
    if (this.c != null)
    {
      int j = 0;
      do
      {
        if (j >= this.c.length) {
          break;
        }
        if (bool1) {
          break label82;
        }
        str = str + this.c[j].toString() + "\n";
        j++;
      } while (!bool1);
    }
    if (!bool2) {
      str = "nodes not initialized yet";
    }
    label82:
    return str;
  }
  
  protected void a()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    int j = 0;
    if (j < 2) {}
    do
    {
      this.d[j].b();
      j++;
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
      this.f.b();
    } while (bool2);
    this.e.b();
  }
  
  boolean b()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    this.c = new k[this.b.k()];
    w localw = this.b.v();
    label98:
    do
    {
      if (!localw.e()) {
        break;
      }
      int j = localw.d().f();
      this.c[j] = new k(localw.d(), -1, null);
      if (bool2) {
        break label230;
      }
      if (bool1) {
        break label229;
      }
      do
      {
        break label98;
        a.c.m localm = localw.d().n();
        do
        {
          if (!localm.e()) {
            break label184;
          }
          if (bool1) {
            break;
          }
          if (localm.a().f() == localm.a().e())
          {
            if (bool2) {
              continue;
            }
            if (!b(localm.a()))
            {
              this.c[j].a(localm.a());
              this.b.f(localm.a());
            }
          }
          localm.f();
        } while (!bool1);
        localw.f();
      } while (bool2);
    } while (!bool1);
    label184:
    this.g.a(this.b);
    a(this.g);
    if (!bool2) {
      c();
    }
    label229:
    label230:
    return true;
  }
  
  private void c()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    int j = 0;
    if (j < this.c.length) {
      if ((bool2) || (this.c[j].z() != null))
      {
        localIterator = this.c[j].z().iterator();
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          this.b.g((d)localIterator.next());
          if (bool2) {
            break label97;
          }
          if (bool1) {
            break label96;
          }
        } while (!bool1);
      }
    }
    label96:
    label97:
    while (bool2)
    {
      Iterator localIterator;
      if (!bool2) {
        j++;
      }
      if (!bool1) {
        break;
      }
    }
  }
  
  private d a(d paramd)
  {
    boolean bool = i;
    if ((bool) || (this.a != null))
    {
      d locald = this.a.b(paramd);
      if (!bool) {
        if (locald != null) {
          return locald;
        }
      }
      return this.a.a(paramd);
    }
    return null;
  }
  
  private boolean b(d paramd)
  {
    if (!i) {
      if (this.a == null) {
        return false;
      }
    }
    return this.a.h(this.a.n(paramd));
  }
  
  private boolean a(l paraml)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    ArrayList localArrayList1 = new ArrayList();
    ArrayList localArrayList2 = new ArrayList();
    k[] arrayOfk = new k[this.c.length];
    int j = 0;
    z[] arrayOfz1 = new z[this.c.length];
    int k = 0;
    do
    {
      if (k >= arrayOfz1.length) {
        break;
      }
      arrayOfz1[k] = new z();
      k++;
      if (bool2) {
        break label593;
      }
      if (bool1) {
        break label591;
      }
    } while (!bool1);
    label101:
    label118:
    label121:
    Object localObject1;
    label166:
    label167:
    Object localObject2;
    k localk1;
    Object localObject4;
    Object localObject5;
    if (!bool2)
    {
      Iterator localIterator = paraml.c();
      label329:
      label339:
      label350:
      do
      {
        do
        {
          do
          {
            break label167;
            break label167;
            break label167;
            break label167;
            break label167;
            break label166;
            break label166;
            break label166;
            break label166;
            if (!localIterator.hasNext()) {
              break;
            }
            localObject1 = (a.c.e)localIterator.next();
            do
            {
              Object localObject6;
              if (this.c[localObject1.f()].j() == -1)
              {
                localArrayList1.add(null);
                localArrayList1.add(this.c[localObject1.f()]);
                localArrayList2.add(null);
                break label350;
                break label350;
              }
              else
              {
                if (localArrayList1.isEmpty()) {
                  break label101;
                }
                localObject2 = (k)localArrayList1.remove(localArrayList1.size() - 1);
                localk1 = (k)localArrayList1.remove(localArrayList1.size() - 1);
                localObject4 = (d)localArrayList2.remove(localArrayList2.size() - 1);
                if ((bool2) || ((!bool2) && (bool1))) {
                  break label589;
                }
                if (((k)localObject2).j() != -1) {
                  break label467;
                }
                if (!bool2) {
                  if (localk1 != null)
                  {
                    localObject5 = new j(localk1, (k)localObject2);
                    localObject6 = new e((i)localObject5, (i)localObject2, (d)localObject4);
                    ((j)localObject5).b((e)localObject6);
                    ((k)localObject2).b((e)localObject6);
                    ((k)localObject2).a(j, (e)localObject6);
                    ((e)localObject6).k();
                    if (bool2) {
                      break label339;
                    }
                    if (!bool1) {
                      break label329;
                    }
                  }
                }
                ((k)localObject2).a(j, null);
                arrayOfk[j] = localObject2;
                j++;
                localObject5 = paraml.a(((k)localObject2).o());
              }
              do
              {
                if (!((Iterator)localObject5).hasNext()) {
                  break;
                }
                localObject6 = (d)((Iterator)localObject5).next();
                if (b((d)localObject6)) {
                  break;
                }
                if (bool2) {
                  break label118;
                }
                if (bool1) {
                  break label121;
                }
                if (((d)localObject6).e() == ((d)localObject6).f()) {
                  break;
                }
                k localk2 = this.c[localObject6.a(localObject2.o()).f()];
                if (!bool2)
                {
                  if (localk2 == localk1) {
                    break;
                  }
                  localArrayList1.add(localObject2);
                  localArrayList1.add(localk2);
                  localArrayList2.add(localObject6);
                }
              } while (bool2);
              if (!bool1) {
                break;
              }
              if (localk1 == null) {
                break;
              }
            } while ((bool2) || (bool1));
          } while (localk1.j() >= ((k)localObject2).j());
          if (bool2) {
            break label535;
          }
          if (localk1.j() != ((k)localObject2).r()) {
            break;
          }
          ((k)localObject2).q().a((d)localObject4);
          if (bool2) {
            break label543;
          }
        } while (!bool1);
        ((k)localObject2).b(localk1.j());
        localObject5 = new e(localk1, (i)localObject2, (d)localObject4);
        arrayOfz1[localk1.j()].add(localObject5);
        if (bool2) {
          break label588;
        }
      } while (!bool1);
      label467:
      this.c = arrayOfk;
      label535:
      label543:
      label588:
      label589:
      m = 0;
    }
    label591:
    label593:
    label726:
    label734:
    label743:
    label746:
    label754:
    label756:
    do
    {
      do
      {
        if (m >= arrayOfz1.length) {
          break;
        }
        do
        {
          do
          {
            do
            {
              if (bool1) {
                break label771;
              }
              if (arrayOfz1[m].isEmpty()) {
                break label746;
              }
              localObject1 = (e)arrayOfz1[m].b();
              localObject2 = ((e)localObject1).e().l();
              localk1 = ((e)localObject1).d().l();
              localObject4 = ((k)localObject2).y();
              if (bool2) {
                break label756;
              }
              if (bool1) {
                break label754;
              }
              if ((!bool2) && (localObject4 == null)) {
                break label734;
              }
              localObject5 = (k)((e)localObject4).d();
              if (bool2) {
                break label719;
              }
              if (localObject5 != localk1) {
                break;
              }
              ((e)localObject4).a(((e)localObject1).i());
              if (bool2) {
                break label726;
              }
            } while (!bool1);
            ((k)localObject2).g((e)localObject1);
            if (bool2) {
              break label743;
            }
          } while (!bool1);
          ((k)localObject2).g((e)localObject1);
        } while (!bool1);
        if (bool2) {
          break label773;
        }
        m++;
      } while (!bool1);
    } while (bool2);
    label719:
    int m = this.c.length - 1;
    label771:
    label773:
    if (m >= 0) {}
    while (bool2)
    {
      if ((!bool2) && (bool1)) {
        break label846;
      }
      localObject1 = this.c[m];
      if (!bool2)
      {
        if (((k)localObject1).q() != null) {
          ((k)localObject1).q().d().l().d(((k)localObject1).s());
        }
        m--;
      }
      if (!bool1) {
        break;
      }
    }
    label846:
    z[] arrayOfz2 = new z[this.c.length];
    int n = this.c.length - 1;
    do
    {
      do
      {
        if (n < 0) {
          break;
        }
        localObject2 = this.c[n];
        int i1 = ((k)localObject2).s();
        if (bool1) {
          break label1178;
        }
        if (arrayOfz2[i1] == null) {
          arrayOfz2[i1] = new z();
        }
        if (((k)localObject2).q() != null) {
          arrayOfz2[i1].b((j)((k)localObject2).q().d());
        }
        n--;
      } while (!bool1);
    } while (bool2);
    n = 0;
    Object localObject3;
    label1074:
    label1092:
    label1095:
    do
    {
      if (n >= arrayOfz2.length) {
        break;
      }
      if (bool1) {
        break label1168;
      }
      if (arrayOfz2[n] != null)
      {
        localObject2 = arrayOfz2[n].iterator();
        do
        {
          do
          {
            if (!((Iterator)localObject2).hasNext()) {
              break label1095;
            }
            localObject3 = (j)((Iterator)localObject2).next();
            if (bool1) {
              break;
            }
            if (((j)localObject3).b().s() == ((j)localObject3).b().j()) {
              break label1074;
            }
            if (bool2) {
              break label1092;
            }
            if (((j)localObject3).b().s() == ((j)localObject3).j()) {
              break label1074;
            }
            ((j)localObject3).a(((j)localObject3).l().a((j)localObject3));
            if (bool2) {
              break label1092;
            }
          } while (!bool1);
          ((j)localObject3).a(null);
          ((j)localObject3).l().c((j)localObject3);
        } while (!bool1);
      }
      n++;
      if (bool2) {
        break label1114;
      }
    } while (!bool1);
    if (!bool2) {
      label1114:
      n = 0;
    }
    label1168:
    label1178:
    label1248:
    label1255:
    do
    {
      do
      {
        if (n >= this.c.length) {
          break;
        }
        if (this.c[n].q() == null) {}
        do
        {
          localArrayList1.add(this.c[n]);
          while (!((Iterator)localObject3).hasNext())
          {
            if (localArrayList1.isEmpty()) {
              break;
            }
            localObject2 = (k)localArrayList1.remove(localArrayList1.size() - 1);
            do
            {
              localObject3 = ((k)localObject2).t().iterator();
              do
              {
                do
                {
                  if (!((Iterator)localObject3).hasNext()) {
                    break;
                  }
                  localObject4 = (e)((Iterator)localObject3).next();
                  ((e)localObject4).d().l().e((e)localObject4);
                  if (bool2) {
                    break label1255;
                  }
                  if (bool1) {
                    break label1248;
                  }
                } while (!bool1);
              } while (bool2);
              localObject3 = ((k)localObject2).b().b();
              do
              {
                if (!((Iterator)localObject3).hasNext()) {
                  break label1291;
                }
                localArrayList1.add(((j)((Iterator)localObject3).next()).b());
                if ((!bool2) && (bool1)) {
                  break;
                }
              } while (!bool1);
              if (bool2) {
                break label1168;
              }
              if (((k)localObject2).n() == null) {
                break;
              }
              if (bool2) {
                break label1168;
              }
            } while (bool1);
            localObject3 = ((k)localObject2).n().iterator();
          }
          localArrayList1.add(((j)((Iterator)localObject3).next()).b());
          if (bool2) {
            break label1377;
          }
          if (bool1) {
            break label1375;
          }
        } while (!bool1);
        if (!bool2) {
          n++;
        }
      } while (!bool1);
    } while (bool2);
    label1291:
    label1375:
    label1377:
    return true;
  }
  
  protected static e a(i parami1, i parami2, int paramInt1, int paramInt2, int paramInt3)
  {
    if (!i) {
      if (parami2.i()) {
        return b(parami1, parami2, paramInt1, paramInt2, paramInt3);
      }
    }
    return parami2.e();
  }
  
  protected static e b(i parami1, i parami2, int paramInt1, int paramInt2, int paramInt3)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    if (!bool2) {
      if (parami1.a(paramInt1) != parami2.a(paramInt2))
      {
        f localf = parami1.j() < parami2.j() ? new f(parami1, parami2, 1) : new f(parami2, parami1, 1);
        if (!bool2)
        {
          if (paramInt1 == 0) {
            parami1.c(localf);
          }
        }
        else
        {
          if (bool2) {
            break label98;
          }
          if (!bool1) {
            break label97;
          }
        }
        parami1.b(localf);
        label97:
        label98:
        if (!bool2)
        {
          if (paramInt2 == 0)
          {
            if (bool2) {
              break label129;
            }
            parami2.c(localf);
          }
        }
        else {
          if (!bool1) {
            break label130;
          }
        }
        label129:
        parami2.b(localf);
        label130:
        return localf;
      }
    }
    return parami1.a(paramInt1);
  }
  
  protected void a(k paramk, int paramInt1, int paramInt2)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    do
    {
      while (!bool1)
      {
        if (!paramk.f(paramInt2)) {
          break;
        }
        paramk.a(paramk.b().h(), paramInt1 ^ 0x1, paramInt1);
      }
    } while (bool2);
  }
  
  protected boolean a(k paramk1, k paramk2, e parame)
  {
    boolean bool3 = i;
    boolean bool2 = h;
    int j = paramk1.j();
    boolean bool1 = false;
    int k = 0;
    boolean[] arrayOfBoolean = new boolean[2];
    k localk = paramk2;
    Object localObject1 = null;
    int m = 0;
    Object localObject2 = localk;
    int n = 0;
    this.d[0].b();
    this.d[1].b();
    this.e.b();
    this.e.a(parame);
    int i1 = 0;
    int i2 = 0;
    int i3 = 0;
    label138:
    label218:
    label223:
    label745:
    label1019:
    do
    {
      do
      {
        Object localObject5;
        int i4;
        Object localObject6;
        do
        {
          if (bool1) {
            break;
          }
          if ((!bool3) && (k >= 2)) {
            break;
          }
          if (!bool3) {
            if (i2 == 0)
            {
              if (bool3) {
                break label138;
              }
              if (i3 == 0) {
                if (bool3) {
                  break label138;
                }
              }
            }
          }
          i2 = localk.e(j) ? 1 : 0;
          if (!bool3) {}
          arrayOfBoolean[0] = (!localk.i() ? 1 : false);
          arrayOfBoolean[1] = false;
          Object localObject3 = null;
          Object localObject4 = null;
          localObject5 = null;
          i4 = 0;
          if (!bool3) {
            if (i2 == 0)
            {
              if (bool3) {
                break label218;
              }
              if (localk.f(j)) {
                a(localk, 1, j);
              }
            }
          }
          i5 = 0;
          do
          {
            if (i5 >= 2) {
              break;
            }
            if (bool3) {
              break label858;
            }
            if (bool2) {
              break label857;
            }
            if (arrayOfBoolean[i5] == 0)
            {
              localObject2 = localk;
              n = i5;
              if (!bool3)
              {
                if ((i5 == 1) && (i2 == 0))
                {
                  if (bool3) {
                    break label323;
                  }
                  if (localObject1 != null)
                  {
                    localObject3 = localk;
                    i1 = i5;
                    localObject4 = localk.a(i5 ^ 0x1);
                    if (bool3) {
                      break label326;
                    }
                    if (!bool2) {
                      break label325;
                    }
                  }
                }
                localObject4 = localk.a(i5);
              }
              localObject3 = ((e)localObject4).a(localk);
              int i6 = 0;
              do
              {
                do
                {
                  do
                  {
                    if (i6 != 0) {
                      break;
                    }
                    if (bool3) {
                      break label847;
                    }
                    if (arrayOfBoolean[i5] != 0) {
                      break;
                    }
                    if (!bool3) {
                      if ((localObject3 instanceof j))
                      {
                        localObject6 = (j)localObject3;
                        i6 = 1;
                        if (!bool3) {
                          if (i2 != 0)
                          {
                            if (bool3) {
                              continue;
                            }
                            if (i5 != 1) {
                              break label478;
                            }
                            if (bool3) {
                              continue;
                            }
                            if (arrayOfBoolean[0] != 0) {
                              break label478;
                            }
                            a(localk, (i)localObject5, 0, i4, 1);
                            arrayOfBoolean[0] = true;
                            if (bool3) {
                              continue;
                            }
                            if (!bool2) {
                              break label478;
                            }
                          }
                        }
                        if (!bool3)
                        {
                          if (i5 == 1) {
                            arrayOfBoolean[0] = true;
                          }
                        }
                        else
                        {
                          if (bool3) {
                            continue;
                          }
                          if (!bool2) {
                            break label478;
                          }
                        }
                        localObject4 = a((i)localObject2, (i)localObject6, n, ((j)localObject6).a((e)localObject4, i5 ^ 0x1), 1);
                        localObject5 = localObject6;
                        i4 = ((j)localObject6).a((e)localObject4, i5 ^ 0x1);
                      }
                    }
                  } while ((!bool3) && ((!bool2) || (!(localObject3 instanceof k))));
                  localObject6 = (k)localObject3;
                  if (bool3) {
                    break label223;
                  }
                  if (bool2) {
                    break;
                  }
                  if (!((k)localObject6).e(j)) {
                    break label603;
                  }
                  k++;
                  arrayOfBoolean[i5] = true;
                  a((i)localObject2, (i)localObject3, n, ((k)localObject6).a((e)localObject4, 0x1 ^ i1), 1);
                  i3 = 1;
                  if (!bool3) {}
                  i6 = arrayOfBoolean[0] == 0 ? 1 : 0;
                } while ((!bool3) && (!bool2));
                if (!bool3)
                {
                  if (((k)localObject6).g(j))
                  {
                    i1 = ((k)localObject6).a((e)localObject4, i1 ^ 0x1) ^ 0x1;
                    if (!bool3) {
                      if (((k)localObject6).f(j)) {
                        a((k)localObject6, i1, j);
                      }
                    }
                    if (bool3) {
                      break label834;
                    }
                    if (!((k)localObject6).t().isEmpty())
                    {
                      e locale = ((k)localObject6).x();
                      n = i1;
                      if (!bool3)
                      {
                        localObject2 = localObject6;
                        if (n == 1)
                        {
                          ((k)localObject6).c(locale);
                          if (bool3) {
                            break label745;
                          }
                          if (!bool2) {
                            break label726;
                          }
                        }
                      }
                      ((k)localObject6).b(locale);
                      localObject4 = locale;
                      this.d[i5].a(locale);
                      if (bool3) {
                        break label834;
                      }
                      if (i2 != 0)
                      {
                        if (!bool3)
                        {
                          if (i5 == 1)
                          {
                            if (bool3) {
                              break label800;
                            }
                            if (arrayOfBoolean[0] == 0) {
                              a(localk, (i)localObject5, 0, i4, 1);
                            }
                          }
                          if (bool3) {
                            break label812;
                          }
                        }
                        if (arrayOfBoolean[(i5 ^ 0x1)] == 0) {
                          k++;
                        }
                        arrayOfBoolean[(i5 ^ 0x1)] = true;
                      }
                    }
                  }
                  localObject4 = ((i)localObject3).a((e)localObject4);
                  localObject3 = ((e)localObject4).a((i)localObject3);
                }
                if (bool3) {
                  break label847;
                }
              } while (!bool2);
            }
            i5++;
          } while (!bool2);
        } while ((bool3) || (k >= 2));
        if ((bool3) || (bool2)) {
          break label1238;
        }
        int i5 = arrayOfBoolean[0] == 0 ? 0 : 1;
        if (localObject1 != null)
        {
          if (!bool3) {
            if (m == i5) {
              localObject1.h();
            }
          }
          if (!bool3)
          {
            if (i5 == 0)
            {
              localk.d().b(localObject1.d());
              if (bool3) {
                break label1019;
              }
              if (!bool2) {}
            }
            else
            {
              localk.d().a(localObject1.d());
            }
          }
          else
          {
            if (bool3) {
              break label1019;
            }
            if (!bool2) {}
          }
        }
        else
        {
          if (!bool3)
          {
            if (i5 == 0)
            {
              if (bool3) {
                break label999;
              }
              localk.c(parame);
            }
          }
          else {
            if (!bool2) {
              break label997;
            }
          }
          localk.b(parame);
          localk.x();
        }
        this.e.a(this.d[i5]);
        if (!bool3) {
          if (i2 == 0) {
            this.e.e(this.d[(i5 ^ 0x1)]);
          }
        }
        if (!bool3)
        {
          if (((j)localObject5).j() == j)
          {
            bool1 = true;
            Iterator localIterator = this.e.d();
            do
            {
              do
              {
                if (!localIterator.hasNext()) {
                  break;
                }
                localObject6 = (e)localIterator.next();
                ((e)localObject6).b((i)localObject5);
                ((e)localObject6).k();
                if ((!bool3) && (bool2)) {
                  break label1156;
                }
              } while (!bool2);
            } while (bool3);
            if (!bool3)
            {
              if (i4 == 0) {
                ((j)localObject5).d().b(this.e);
              }
            }
            else
            {
              if (bool3) {
                break label1177;
              }
              if (!bool2) {
                break label1168;
              }
            }
            ((j)localObject5).d().d(this.e);
            this.e.b();
            if (bool3) {
              continue;
            }
            if (!bool2) {}
          }
          else
          {
            ((j)localObject5).m();
            localObject1 = localObject5;
            m = i4;
            localk = ((j)localObject5).l();
          }
        }
        else {
          k = 0;
        }
        this.d[0].b();
        this.d[1].b();
      } while (bool3);
    } while (!bool2);
    label323:
    label325:
    label326:
    label478:
    label997:
    label999:
    return bool1;
  }
  
  private void a(a parama, k paramk)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    Iterator localIterator = parama.d();
    if (localIterator.hasNext()) {}
    while (bool2)
    {
      e locale = (e)localIterator.next();
      if (bool1) {
        return;
      }
      if (!bool2) {
        if (locale.e() != paramk) {
          locale.e().d(locale);
        }
      }
      locale.k();
      if (!bool1) {
        break;
      }
    }
    this.f.a(parama);
  }
  
  private boolean c(k paramk1, k paramk2, e parame)
  {
    boolean bool3 = i;
    boolean bool2 = h;
    int j = paramk1.j();
    boolean bool1 = false;
    int k = 0;
    boolean[] arrayOfBoolean = new boolean[2];
    int m = -1;
    k localk = paramk2;
    Object localObject1 = null;
    int n = 0;
    Object localObject2 = localk;
    int i1 = 0;
    this.d[0].b();
    this.d[1].b();
    this.e.b();
    this.e.a(parame);
    int i2 = 0;
    int i3 = 0;
    int i4 = 0;
    localk.x();
    label147:
    label227:
    label232:
    label893:
    do
    {
      do
      {
        do
        {
          do
          {
            do
            {
              if (bool1) {
                break label1367;
              }
              if ((!bool3) && (k >= 2)) {
                break label1367;
              }
              if (!bool3) {
                if (i3 == 0)
                {
                  if (bool3) {
                    break label147;
                  }
                  if (i4 == 0) {
                    if (bool3) {
                      break label147;
                    }
                  }
                }
              }
              i3 = localk.e(j) ? 1 : 0;
              if (!bool3) {}
              arrayOfBoolean[0] = (!localk.i() ? 1 : false);
              arrayOfBoolean[1] = false;
              Object localObject3 = null;
              Object localObject4 = null;
              Object localObject5 = null;
              int i5 = 0;
              if (!bool3) {
                if (i3 == 0)
                {
                  if (bool3) {
                    break label227;
                  }
                  if (localk.f(j)) {
                    a(localk, 1, j);
                  }
                }
              }
              int i6 = 0;
              Object localObject6;
              do
              {
                if (i6 >= 2) {
                  break;
                }
                if (bool3) {
                  break label951;
                }
                if (bool2) {
                  break label950;
                }
                if (arrayOfBoolean[i6] == 0)
                {
                  localObject2 = localk;
                  i1 = i6;
                  if (!bool3)
                  {
                    if ((i6 == 1) && (i3 == 0))
                    {
                      if (bool3) {
                        break label332;
                      }
                      if (localObject1 != null)
                      {
                        localObject3 = localk;
                        i2 = i6;
                        localObject4 = localk.a(i6 ^ 0x1);
                        if (bool3) {
                          break label335;
                        }
                        if (!bool2) {
                          break label334;
                        }
                      }
                    }
                    localObject4 = localk.a(i6);
                  }
                  localObject3 = ((e)localObject4).a(localk);
                  int i7 = 0;
                  do
                  {
                    do
                    {
                      do
                      {
                        if (i7 != 0) {
                          break;
                        }
                        if (bool3) {
                          break label940;
                        }
                        if (arrayOfBoolean[i6] != 0) {
                          break;
                        }
                        if (!bool3) {
                          if ((localObject3 instanceof j))
                          {
                            localObject6 = (j)localObject3;
                            i7 = 1;
                            if (!bool3) {
                              if (i3 != 0)
                              {
                                if (bool3) {
                                  continue;
                                }
                                if (i6 != 1) {
                                  break label487;
                                }
                                if (bool3) {
                                  continue;
                                }
                                if (arrayOfBoolean[0] != 0) {
                                  break label487;
                                }
                                a(localk, (i)localObject5, 0, i5, 1);
                                arrayOfBoolean[0] = true;
                                if (bool3) {
                                  continue;
                                }
                                if (!bool2) {
                                  break label487;
                                }
                              }
                            }
                            if (!bool3)
                            {
                              if (i6 == 1) {
                                arrayOfBoolean[0] = true;
                              }
                            }
                            else
                            {
                              if (bool3) {
                                continue;
                              }
                              if (!bool2) {
                                break label487;
                              }
                            }
                            localObject4 = a((i)localObject2, (i)localObject6, i1, ((j)localObject6).a((e)localObject4, i6 ^ 0x1), 1);
                            localObject5 = localObject6;
                            i5 = ((j)localObject6).a((e)localObject4, i6 ^ 0x1);
                          }
                        }
                      } while ((!bool3) && ((!bool2) || (!(localObject3 instanceof k))));
                      localObject6 = (k)localObject3;
                      if (bool3) {
                        break label232;
                      }
                      if (bool2) {
                        break;
                      }
                      if (!((k)localObject6).e(j)) {
                        break label696;
                      }
                      k++;
                      arrayOfBoolean[i6] = true;
                      if (!bool3)
                      {
                        if (i3 == 0)
                        {
                          a((i)localObject2, (i)localObject3, i1, ((k)localObject6).a((e)localObject4, 0x1 ^ i2), 1);
                          if (bool3) {
                            break label671;
                          }
                          if (!bool2) {}
                        }
                        else
                        {
                          a(this.d[i6], paramk2);
                        }
                      }
                      else
                      {
                        if ((bool3) || ((i6 == 0) && ((bool3) || (arrayOfBoolean[1] != 0))))
                        {
                          arrayOfBoolean[1] = false;
                          k--;
                        }
                        a(localk, (i)localObject3, i6, ((k)localObject6).a((e)localObject4, 0x1 ^ i2), 1);
                      }
                      i4 = 1;
                      if (!bool3) {}
                      i7 = arrayOfBoolean[0] == 0 ? 1 : 0;
                    } while ((!bool3) && (!bool2));
                    if (!bool3)
                    {
                      if (((k)localObject6).g(j))
                      {
                        i2 = ((k)localObject6).a((e)localObject4, i2 ^ 0x1) ^ 0x1;
                        if (!bool3) {
                          if (((k)localObject6).f(j)) {
                            a((k)localObject6, i2, j);
                          }
                        }
                        if (bool3) {
                          break label927;
                        }
                        if (!((k)localObject6).t().isEmpty())
                        {
                          e locale = ((k)localObject6).x();
                          i1 = i2;
                          if (!bool3)
                          {
                            localObject2 = localObject6;
                            if (i1 == 1)
                            {
                              ((k)localObject6).c(locale);
                              if (bool3) {
                                break label838;
                              }
                              if (!bool2) {
                                break label819;
                              }
                            }
                          }
                          ((k)localObject6).b(locale);
                          localObject4 = locale;
                          this.d[i6].a(locale);
                          if (bool3) {
                            break label927;
                          }
                          if (i3 != 0)
                          {
                            if (!bool3)
                            {
                              if (i6 == 1)
                              {
                                if (bool3) {
                                  break label893;
                                }
                                if (arrayOfBoolean[0] == 0) {
                                  a(localk, (i)localObject5, 0, i5, 1);
                                }
                              }
                              if (bool3) {
                                break label905;
                              }
                            }
                            if (arrayOfBoolean[(i6 ^ 0x1)] == 0) {
                              k++;
                            }
                            arrayOfBoolean[(i6 ^ 0x1)] = true;
                          }
                        }
                      }
                      localObject4 = ((i)localObject3).a((e)localObject4);
                      localObject3 = ((e)localObject4).a((i)localObject3);
                    }
                    if (bool3) {
                      break label940;
                    }
                  } while (!bool2);
                }
                i6++;
              } while (!bool2);
              if (bool3) {
                break label1325;
              }
              if (k >= 2) {
                break;
              }
              if (!bool3) {}
              i6 = arrayOfBoolean[0] == 0 ? 0 : 1;
              if ((bool3) || (localObject1 != null))
              {
                ((j)localObject1).n();
                localk.a((j)localObject1, n, i6);
                if (bool3) {
                  break label1030;
                }
                if (!bool2) {}
              }
              else
              {
                m = i6;
              }
              this.e.a(this.d[i6]);
              if (!bool3) {
                if (i3 == 0) {
                  this.e.e(this.d[(i6 ^ 0x1)]);
                }
              }
              if (!bool3)
              {
                if (((j)localObject5).j() == j)
                {
                  bool1 = true;
                  if (!bool3)
                  {
                    if (m == 0)
                    {
                      if (bool3) {
                        break label1103;
                      }
                      paramk2.c(parame);
                    }
                  }
                  else {
                    if (!bool2) {
                      break label1104;
                    }
                  }
                  paramk2.b(parame);
                  Iterator localIterator = this.e.d();
                  do
                  {
                    do
                    {
                      if (!localIterator.hasNext()) {
                        break;
                      }
                      localObject6 = (e)localIterator.next();
                      ((e)localObject6).b((i)localObject5);
                      ((e)localObject6).k();
                      if ((!bool3) && (bool2)) {
                        break label1199;
                      }
                    } while (!bool2);
                  } while (bool3);
                  if (!bool3)
                  {
                    if (i5 == 0) {
                      ((j)localObject5).d().b(this.e);
                    }
                  }
                  else
                  {
                    if (bool3) {
                      break label1220;
                    }
                    if (!bool2) {
                      break label1211;
                    }
                  }
                  ((j)localObject5).d().d(this.e);
                  this.e.b();
                  if (bool3) {
                    continue;
                  }
                  if (!bool2) {}
                }
                else
                {
                  localObject1 = localObject5;
                  n = i5;
                  localk = ((j)localObject5).l();
                }
              }
              else
              {
                if (!bool3) {
                  if (!((j)localObject1).b(j)) {
                    ((j)localObject5).m();
                  }
                }
                k = 0;
              }
              this.d[0].b();
              this.d[1].b();
              if (bool3) {
                break label1325;
              }
            } while (!bool2);
            a(this.d[0], paramk2);
            a(this.d[1], paramk2);
            a(this.e, paramk2);
          } while (localObject1 == null);
          if ((bool3) || (bool2)) {
            break label1369;
          }
        } while (((j)localObject1).b(j));
        localk.c((j)localObject1);
      } while (bool3);
    } while (!bool2);
    label332:
    label334:
    label335:
    label487:
    return bool1;
  }
  
  protected void d()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    do
    {
      for (int j = 0; !bool1; j++)
      {
        if (j >= this.c.length) {
          break;
        }
        this.c[j].m();
      }
    } while (bool2);
  }
  
  private void e()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    ArrayList localArrayList = new ArrayList();
    int[] arrayOfInt = new int[this.c.length];
    label78:
    label240:
    label250:
    label255:
    do
    {
      int j = 0;
      while (!bool1)
      {
        if (j >= this.c.length) {
          break;
        }
        if (!bool2)
        {
          if (arrayOfInt[this.c[j].j()] == 0)
          {
            arrayOfInt[this.c[j].j()] = 1;
            do
            {
              int k;
              e locale;
              k localk2;
              do
              {
                k localk1;
                do
                {
                  localArrayList.add(this.c[j]);
                  break label133;
                  break label133;
                  do
                  {
                    if (localArrayList.isEmpty()) {
                      break label250;
                    }
                    do
                    {
                      localk1 = (k)localArrayList.remove(localArrayList.size() - 1);
                      k = arrayOfInt[localk1.j()];
                      if (k < 0) {
                        localk1.d().c();
                      }
                      Iterator localIterator = localk1.d().d();
                      if (!localIterator.hasNext()) {
                        break;
                      }
                      locale = (e)localIterator.next();
                    } while ((bool2) || (bool1));
                    if (locale.a() == null) {
                      break label78;
                    }
                    if (bool2) {
                      break;
                    }
                  } while (bool1);
                } while (!locale.l());
                localk2 = locale.a(localk1).l();
                if (bool2) {
                  break label240;
                }
              } while (localk2.q() != locale);
              localArrayList.add(localk2);
              arrayOfInt[localk2.j()] = (k * locale.g());
              if (bool2) {
                break label255;
              }
            } while (!bool1);
          }
          j++;
        }
      }
    } while (bool2);
    label133:
  }
  
  private void f()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    a.c.m localm = this.b.w();
    do
    {
      do
      {
        if (!localm.e()) {
          break;
        }
        this.b.f(localm.a());
        localm.f();
      } while (!bool1);
    } while (bool2);
    int j = 0;
    label64:
    label82:
    label88:
    do
    {
      if (j >= this.c.length) {
        break;
      }
      k localk = this.c[j];
      Iterator localIterator1;
      do
      {
        localIterator1 = localk.d().d();
        break label138;
        break label138;
        e locale;
        do
        {
          do
          {
            if (!localIterator1.hasNext()) {
              break;
            }
            locale = (e)localIterator1.next();
          } while (locale.a() == null);
          if (bool2) {
            break label64;
          }
          if (bool1) {
            break;
          }
        } while (!locale.l());
        Iterator localIterator2 = locale.a().iterator();
        do
        {
          if (!localIterator2.hasNext()) {
            break label82;
          }
          d locald = (d)localIterator2.next();
          if (locald.e() != localk.o()) {
            break;
          }
          this.b.g(locald);
          if (bool2) {
            break label88;
          }
          if ((!bool2) && (bool1)) {
            break label206;
          }
        } while (bool2);
      } while (!bool1);
      if ((bool2) || (localk.z() != null))
      {
        localIterator1 = localk.z().iterator();
        if (localIterator1.hasNext()) {
          this.b.g((d)localIterator1.next());
        }
      }
      for (;;)
      {
        if (!bool2) {
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            if (bool2) {
              continue;
            }
            j++;
          }
        }
      }
    } while (!bool1);
    label138:
    label206:
    return;
  }
  
  private void g()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    z localz = new z();
    int j = 0;
    label41:
    label42:
    label48:
    label184:
    label186:
    label204:
    label363:
    label365:
    do
    {
      if (j >= this.c.length) {
        break;
      }
      Object localObject1 = this.c[j].d().d();
      break label204;
      if (((Iterator)localObject1).hasNext()) {}
      Object localObject2;
      Object localObject3;
      while (bool2)
      {
        localObject2 = (e)((Iterator)localObject1).next();
        if (((e)localObject2).a() == null) {
          break label42;
        }
        if ((bool2) || (bool1)) {
          break;
        }
        if (((e)localObject2).a(this.c[j]).j() <= j) {
          break label42;
        }
        if (!bool2) {
          if (((e)localObject2).l())
          {
            localz.clear();
            localObject3 = ((e)localObject2).a().iterator();
            do
            {
              do
              {
                if (!((Iterator)localObject3).hasNext()) {
                  break;
                }
                localz.a(a((d)((Iterator)localObject3).next()));
                if (bool2) {
                  break label186;
                }
                if (bool1) {
                  break label184;
                }
              } while (!bool1);
            } while (bool2);
            ((e)localObject2).a().addAll(localz);
            if (bool2) {
              break label48;
            }
            if (!bool1) {
              break label42;
            }
          }
        }
        localObject3 = ((e)localObject2).a().iterator();
        if (!((Iterator)localObject3).hasNext()) {
          break label42;
        }
        if (!bool2)
        {
          this.b.f((d)((Iterator)localObject3).next());
          if ((!bool1) && (!bool1)) {
            break label41;
          }
        }
      }
      if ((bool2) || (this.c[j].z() != null))
      {
        localObject1 = new z();
        localObject2 = this.c[j].z().iterator();
        if (((Iterator)localObject2).hasNext()) {}
        while (bool2)
        {
          localObject3 = (d)((Iterator)localObject2).next();
          ((z)localObject1).b(localObject3);
          ((z)localObject1).b(a((d)localObject3));
          if (bool2) {
            break label365;
          }
          if (bool1) {
            break label363;
          }
          if (!bool1) {
            break;
          }
        }
        this.c[j].a((z)localObject1);
      }
      j++;
    } while (!bool1);
  }
  
  private boolean c(cb paramcb)
  {
    if (paramcb == null) {
      return false;
    }
    this.a = paramcb;
    return a(paramcb.a());
  }
  
  public boolean a(q paramq)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    this.b = paramq;
    a();
    b();
    int j = this.c.length - 1;
    label123:
    do
    {
      if (j < 0) {
        break;
      }
      Iterator localIterator = this.c[j].h().iterator();
      for (;;)
      {
        if (localIterator.hasNext())
        {
          e locale = (e)localIterator.next();
          if (!locale.l())
          {
            if (bool2) {
              break label123;
            }
            if (bool1) {
              break;
            }
            if (!a(this.c[j], locale.a(this.c[j]).l(), locale)) {
              return false;
            }
          }
        }
      }
      j--;
    } while (!bool1);
    return true;
  }
  
  private boolean d(cb paramcb)
  {
    if (paramcb == null) {
      return false;
    }
    this.a = paramcb;
    return c(paramcb.a());
  }
  
  private boolean c(q paramq)
  {
    boolean bool3 = i;
    boolean bool2 = h;
    this.b = paramq;
    a();
    b();
    boolean bool1 = true;
    int j = this.c.length - 1;
    label138:
    do
    {
      if (j < 0) {
        break;
      }
      Iterator localIterator = this.c[j].h().iterator();
      do
      {
        do
        {
          e locale;
          do
          {
            if (!localIterator.hasNext()) {
              break;
            }
            locale = (e)localIterator.next();
          } while (locale.l());
          if (bool3) {
            break label138;
          }
          if (bool2) {
            break;
          }
        } while (c(this.c[j], locale.a(this.c[j]).l(), locale));
        bool1 = false;
        if (bool3) {
          break label138;
        }
      } while (!bool2);
      j--;
    } while (!bool2);
    return bool1;
  }
  
  private void h()
  {
    e();
    d();
    g();
    f();
  }
  
  private int a(n paramn)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    int j = 0;
    a.c.m localm = paramn.a();
    do
    {
      do
      {
        if (!localm.e()) {
          break;
        }
        j++;
        localm.f();
      } while (!bool1);
    } while (bool2);
    return j;
  }
  
  public boolean a(cb paramcb)
  {
    boolean bool2 = i;
    boolean bool1 = h;
    if (!bool2) {
      if (c(paramcb))
      {
        h();
        paramcb.f();
        a.f.j.o localo1 = paramcb.b();
        if (!bool2) {
          if (!localo1.e()) {
            return true;
          }
        }
        n localn = localo1.a();
        localn = null;
        int j = 0;
        a.f.j.o localo2 = paramcb.b();
        do
        {
          if (!localo2.e()) {
            break;
          }
          int k = localo2.a().a().k();
          if ((!bool2) && (bool1)) {
            break label152;
          }
          if (k > j)
          {
            j = k;
            localn = localo2.a();
          }
          localo2.f();
        } while (!bool1);
        paramcb.a(localn);
        if ((!bool2) && (paramcb.h())) {
          label152:
          return true;
        }
        throw new RuntimeException("Constructed planar embedding was corrupt!");
      }
    }
    return false;
  }
  
  public ab i()
  {
    boolean bool2 = i;
    boolean bool1 = h;
    ab localab = new ab();
    do
    {
      Iterator localIterator = this.f.d();
      while (!bool1)
      {
        if (!localIterator.hasNext()) {
          break;
        }
        if (bool1) {
          break label65;
        }
        localab.addAll(((e)localIterator.next()).a());
      }
    } while (bool2);
    label65:
    return localab;
  }
  
  public boolean e(cb paramcb)
  {
    boolean bool = d(paramcb);
    h();
    paramcb.f();
    n localn = paramcb.b().a();
    paramcb.a(localn);
    return bool;
  }
  
  void d(q paramq)
  {
    this.b = paramq;
    b();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.j.a.c

 * JD-Core Version:    0.7.0.1

 */